package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**刷道排行榜记录*/
@Setter
@Getter
public class ShuaDaoRankRecord extends RankRecord {
    private String gid;
    private int time;
    private short level;
    private String partyName;//帮派名
    private String name;//角色名称
    private short polar;//门派 相性
    private short roleIcon;//角色图标

    public ShuaDaoRankRecord() {}

    public ShuaDaoRankRecord(String gid, int time, short level, String partyName, String name, short polar, short roleIcon) {
        this.gid = gid;
        this.time = time;
        this.level = level;
        this.partyName = partyName;
        this.name = name;
        this.polar = polar;
        this.roleIcon = roleIcon;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按时间从小到大排序*/
        ShuaDaoRankRecord other = (ShuaDaoRankRecord)o;
        if (time != other.getTime()) {
            return time > other.time ? 1 : -1;
        }

        /**用时一样时，就按gid排序吧，保证不是同一个玩家就好了*/
        return gid.compareTo(other.getGid());
    }
}
